From: Giovanni Campagna Date: Fri, 17 Aug 2012 17:08:17 +0000 (+0200) Subject: ScreenShield: make .lock() and .unlock() idempotent X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~6166 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=8dc9ceb2bcb1511f77c3e457dbbd775b70ab2a5c;p=gnome-shell.git ScreenShield: make .lock() and .unlock() idempotent Those methods can be called multiple times in certain situations, and will be even more so after hooking them to the system bus. --- diff --git a/js/ui/screenShield.js b/js/ui/screenShield.js index f37541769..c4a23b6e9 100644 --- a/js/ui/screenShield.js +++ b/js/ui/screenShield.js @@ -616,11 +616,13 @@ const ScreenShield = new Lang.Class({ this._lightbox.hide(); - Main.popModal(this.actor); - this.actor.hide(); + if (this._isModal) { + Main.popModal(this.actor); + this._isModal = false; + } - this._isModal = false; this._isLocked = false; + this.actor.hide(); this.emit('lock-status-changed', false); },